import Trademark from "@/pages/product/trademark";
import {atguiguRequest} from "@/request"


/**
 * 品牌管理
 */
export interface TrademarkListType {
    current: number;
    pages: number;
    records: Record[];
    searchCount: boolean;
    size: number;
    total: number;
}

export interface Record {
    id: number;
    logoUrl: string;
    tmName: string;
}
/*
* 添加品牌的数据类型
* */
export interface TrademarkInfoType {
    id?: number,
    logoUrl: string,
    tmName: string
}


//品牌分页的列表
export const reqTrademarkPageLimit = (page:number,limit:number)=>{
    return atguiguRequest.get<any,TrademarkListType>(`/admin/product/baseTrademark/${page}/${limit}`)
}

//添加品牌的请求
export const reqTrademarkSave = (trademarkInfo:TrademarkInfoType)=>{
    return atguiguRequest.post<any,null>(`/admin/product/baseTrademark/save`,trademarkInfo)
}
//修改品牌请求
export const reqTrademarkUpdate = (trademarkInfo:TrademarkInfoType)=>{
    return atguiguRequest.put<any,null>(`/admin/product/baseTrademark/update`,trademarkInfo)
}
//删除单个品牌
export const reqDeleteTrademark = (id:number)=>{
    return atguiguRequest.delete(`/admin/product/baseTrademark/remove/${id}`)
}
